package TestCases;

import java.util.HashMap;
import java.util.Map;
import com.crc.mam.BaseCase;
import coms.Constants;
import coms.process.LoginTest;
import coms.process.TravelClaimProcess;
import frame.FrameWork;
import frame.InterTest;

/**
 * 差旅费事前申请
 * @author CHENHAILIAN6
 *
 */
public class TravelAuditTestcase extends BaseCase implements InterTest{

  public static void main(String[] args) {
    
    TravelAuditTestcase audit = new TravelAuditTestcase();
    HashMap<Object, Object> inputParam = new HashMap<Object, Object>();
    String url = "http://10.0.49.123";
    inputParam.put("url", url);
    audit.run(inputParam);
    
  }



  @Override
  public void run(Map<Object, Object> paramMap) {
    String url = (String) paramMap.get("url");
    if(url == null) {
      url = Constants.BASE_URL;
    }
    FrameWork.setBaseUrl(url);
    LoginTest loginTest = new LoginTest();
    loginTest.run(paramMap);
    
    if(loginTest.status) {  
      TravelClaimProcess process = new TravelClaimProcess();
      process.run(paramMap);
      HashMap<Object ,Object> inputParam = new HashMap<Object ,Object>();
      inputParam.put("claimId", process.getClaimId());
      inputParam.put("claimNo", process.getClaimNo());
      inputParam.put("amount", process.getAmount());
      AuditProcessTestcase audit = new AuditProcessTestcase();
      audit.run(inputParam);
     
    }
    
  }



  @Override
  public boolean getStatus() {
    // TODO Auto-generated method stub
    return false;
  }



  @Override
  public String getRemark() {
    // TODO Auto-generated method stub
    return null;
  }

}
